package com.adtech.adms.device.service.impl;

import java.util.List;

import com.adtech.adms.device.DeviceConstants;
import com.adtech.adms.device.pojo.GuiDeviceaction;
import com.adtech.adms.device.service.ActionService;
import com.adtech.core.dao.HibernateDAO;
import com.adtech.core.dao.exp.Expression;
import com.adtech.core.dao.query.Pager;
import com.adtech.core.dao.query.QueryConstants;
import com.adtech.core.dao.query.Sort;

public class ActionServiceImpl implements ActionService {
	private HibernateDAO dao;

	public void setDao(HibernateDAO dao) {
		this.dao = dao;
	}

	@Override
	public List<GuiDeviceaction> getActionList(Pager pager, Expression expression,
			Sort sort) {
		// TODO Auto-generated method stub
		if (sort == null || sort.isEmpty()) {
			sort = new Sort();
			sort.addSort(DeviceConstants.Device.ID, QueryConstants.DESC);
		}
		return (List<GuiDeviceaction>) dao.getByQuery(GuiDeviceaction.class, pager,
				expression, sort);
	}


}
